import http from "@/utils/http";
// 获取列表
export function ListAPI() {
  return http({
    url: '/posts',
    method: 'get',
  })
}
// 删除
export function DelAPI(id) {
  return http({
    url: '/posts/' + id,
    method: 'delete',
  })
}

// 发布
export function FaBuAPI(title, content, status) {
  return http({
    url: '/posts',
    method: 'post',
    data: {
      title, content, status
    }
  })
}

// 修改
export function XiuGaiAPI(id, title, content, status) {
  return http({
    url: '/posts/' + id,
    method: 'patch',
    data: {
      title, content, status
    }
  })
}
export default { ListAPI, DelAPI, FaBuAPI, XiuGaiAPI }